/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Game;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;

/**
 *
 * @author Portatil
 */
public class CargaGuardaTxT {

    static void inicio(ArrayList<String> nom) {
        FileReader fr;
        BufferedReader br;
        String linea;
        try {
            fr = new FileReader("Resultados.txt");
            br = new BufferedReader(fr);
            while ((linea = br.readLine()) != null) {
                nom.add(linea);
            }
            br.close();
        } catch (IOException ex) {
            System.out.println("Error");
        }
    }

    static void fin(ArrayList<String> nom) {
        FileWriter fw;
        BufferedWriter bw;
        try {
            fw = new FileWriter("Resultados.txt");
            bw = new BufferedWriter(fw);
            for (int i = 0; i < nom.size(); i++) {
                bw.write(nom.get(i));
                bw.write("\n");
            }
            bw.close();
        } catch (IOException ex) {
            System.out.println("Error");
        }
    }
}
